Disable tooltips if gtk-touchscreen-mode is activated (#315112).
authorRoss Burton <ross@openedhand.com>
Thu, 2 Mar 2006 14:24:54 +0000 (14:24 +0000)
committerRoss Burton <rburton@src.gnome.org>
Thu, 2 Mar 2006 14:24:54 +0000 (14:24 +0000)
2006-03-02  Ross Burton  <ross@openedhand.com>

* gtk/gtktooltips.c:
Disable tooltips if gtk-touchscreen-mode is activated (#315112).

ChangeLog
ChangeLog.pre-2-10
gtk/gtktooltips.c

index 500aae7b389f5c2602db748aac0bb0fc8fe1c68d..523a16b555c2fa2036414966c3732c3b2133aea4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-03-02  Ross Burton  <ross@openedhand.com>
+
+       * gtk/gtktooltips.c:
+       Disable tooltips if gtk-touchscreen-mode is activated (#315112).
+
 2006-03-01  Kristian Rietveld  <kris@imendio.com>
 
        * gtk/gtktreeselection.c (row_is_selectable): rename to
index 500aae7b389f5c2602db748aac0bb0fc8fe1c68d..523a16b555c2fa2036414966c3732c3b2133aea4 100644 (file)
@@ -1,3 +1,8 @@
+2006-03-02  Ross Burton  <ross@openedhand.com>
+
+       * gtk/gtktooltips.c:
+       Disable tooltips if gtk-touchscreen-mode is activated (#315112).
+
 2006-03-01  Kristian Rietveld  <kris@imendio.com>
 
        * gtk/gtktreeselection.c (row_is_selectable): rename to
index 7fdf526c747884a3f4c38a64a8567f5e142fd2e0..ed505915cea47cc9999aca9bc2bb7abb7f9974a5 100644 (file)
@@ -610,6 +610,21 @@ stop_keyboard_mode (GtkWidget *widget)
     }
 }
 
+static gboolean
+tooltips_enabled (GtkTooltips *tooltips, GtkWidget *w)
+{
+  GtkSettings *settings;
+  gboolean touchscreen;
+
+  if (!tooltips->enabled)
+    return FALSE;
+
+  settings = gtk_widget_get_settings (w);
+  g_object_get (settings, "gtk-touchscreen-mode", &touchscreen, NULL);
+  
+  return !touchscreen;
+}
+
 static void
 gtk_tooltips_start_delay (GtkTooltips *tooltips,
                          GtkWidget   *widget)
@@ -617,7 +632,7 @@ gtk_tooltips_start_delay (GtkTooltips *tooltips,
   GtkTooltipsData *old_tips_data;
   
   old_tips_data = tooltips->active_tips_data;
-  if (tooltips->enabled &&
+  if (tooltips_enabled (tooltips, widget) &&
       (!old_tips_data || old_tips_data->widget != widget))
     {
       guint delay;